home *** CD-ROM | disk | FTP | other *** search
- package javax.swing.plaf.basic;
-
- import java.awt.Rectangle;
- import java.awt.event.ActionEvent;
- import javax.swing.AbstractAction;
- import javax.swing.tree.TreePath;
-
- class BasicTreeUI$TreeScrollLRAction extends AbstractAction {
- // $FF: synthetic field
- private final BasicTreeUI this$0;
- protected int direction;
- private boolean addToSelection;
-
- public BasicTreeUI$TreeScrollLRAction(BasicTreeUI var1, int var2, String var3, boolean var4) {
- this.this$0 = var1;
- this.direction = var2;
- this.addToSelection = var4;
- }
-
- public void actionPerformed(ActionEvent var1) {
- if (this.this$0.tree != null && this.this$0.getRowCount(this.this$0.tree) > 0 && this.this$0.treeSelectionModel != null) {
- Rectangle var4 = this.this$0.tree.getVisibleRect();
- TreePath var3;
- if (this.direction == -1) {
- var3 = this.this$0.getClosestPathForLocation(this.this$0.tree, var4.x, var4.y);
- var4.x = Math.max(0, var4.x - var4.width);
- } else {
- var4.x = Math.min(Math.max(0, this.this$0.tree.getWidth() - var4.width), var4.x + var4.width);
- var3 = this.this$0.getClosestPathForLocation(this.this$0.tree, var4.x, var4.y + var4.height);
- }
-
- this.this$0.tree.scrollRectToVisible(var4);
- if (this.addToSelection) {
- BasicTreeUI.access$7(this.this$0, var3);
- } else if (BasicTreeUI.access$8(this.this$0)) {
- this.this$0.tree.setSelectionPath(var3);
- } else {
- BasicTreeUI.access$6(this.this$0, var3, true);
- }
- }
-
- }
-
- public boolean isEnabled() {
- return this.this$0.tree != null && this.this$0.tree.isEnabled();
- }
- }
-